package com.noble.glamour.module.logic.config;

import com.noble.library.log.PSP;
import com.noble.library.utils.TypeConvertUtil;

/**
 * 应用常量
 * Created by ZRP on 2016/9/19.
 */
public class Constant {

    // ------------------------- 渠道信息 ---------------------------
    public static final String APP_CHANNEL = "meet_app_channel";  // 包渠道存储key

    private static int channel = 0;

    private static void reGetChannel() {
        if (channel == 0) {
            channel = TypeConvertUtil.toInt(PSP.getInstance().getString(APP_CHANNEL, "0"), 0);
        }
    }

    /**
     * 换皮包 id 设置
     */
    public static int getAppId() {
        reGetChannel();
        int APP_ID;
        if (channel <= 500) {   // 初始原包
            APP_ID = 1;
        } else if (channel <= 1000) {  // 微信支付更换包
            APP_ID = 2;
        } else {                     // 换皮包
            APP_ID = 3;
        }
        return APP_ID;
    }

    // -------------------------版本信息常量---------------------------

    // [以下3个参数对应文档](http://test.game.xiaoyouapp.cn:20080/juxin/api_doc/src/master/version/versions.md)
    public static final int MS_TYPE = 10;           //消息版本号
    public static final int SUB_VERSION = 10;       //客户端版本号
    public static final int PLATFORM_TYPE = 2;      //平台号：2为android，3为iphone

    public static final String APP_IS_FOREGROUND = "app_is_foreground";//是否属于前台显示

    // -----------------------私有K-V-----------------------
    public static final String PRIVATE_CHAT_TOP_H = "private_chat_top_h"; //私聊页顶部三个高度

    // -------------------------K-V---------------------------
    public static final String SETTING_MESSAGE = "setting_message";             //是否进行消息提示，存储key及默认值
    public static final boolean SETTING_MESSAGE_DEFAULT = true;

    public static final String IS_SHOW_MESSAGE = "is_show_message";             // 是否显示过通知栏
    public static final String SETTING_QUIT_MESSAGE = "setting_quit_message";   //是否进行锁屏弹窗，存储key及默认值
    public static final boolean SETTING_QUIT_MESSAGE_DEFAULT = true;
    public static final String SETTING_VIBRATION = "setting_vibration";         //是否进行新消息震动提示，存储key及默认值
    public static final boolean SETTING_VIBRATION_DEFAULT = true;
    public static final String SETTING_VOICE = "setting_voice";                 //是否进行新消息声音提示，存储key及默认值
    public static final boolean SETTING_VOICE_DEFAULT = true;
    public static final String SETTING_SLEEP_MESSAGE = "setting_sleep_message"; //是否睡眠免打扰，存储key及默认值
    public static final boolean SETTING_SLEEP_MESSAGE_DEFAULT = true;

    public static final long HOUR_TIME = 60 * 60 * 1000;              //1小时
    public static final long FOUR_HOUR_TIME = 4 * 60 * 60 * 1000;             //4小时

}
